package cool.taomu.box.storage.indexed.abs

import cool.taomu.box.storage.indexed.inter.IIndexed
import cool.taomu.box.storage.indexed.rhino.JsRhinoScript

abstract class AbsIndexed implements IIndexed {
	protected def Object getKeyPath(String key, String result) {
		var js = new JsRhinoScript();
		js.loaderScript(String.format("function getKeyPath(key) { return JSON.parse('%s')[key];}", result))
		return js.invoke("getKeyPath", key)
	}
}
